/**
 * "Visual Paradigm: DO NOT MODIFY THIS FILE!"
 * 
 * This is an automatic generated file. It will be regenerated every time 
 * you generate persistence class.
 * 
 * Modifying its content may cause the program not work, or your work may lost.
 */

/**
 * Licensee: DuKe TeAm
 * License Type: Purchased
 */
package smartgrid;

import org.hibernate.Criteria;
import org.orm.PersistentException;
import org.orm.PersistentSession;
import org.orm.criteria.*;

public class DataLineCriteria extends AbstractORMCriteria {
	public final IntegerExpression ID;
	public final DateExpression timeStamp;
	public final DoubleExpression Value;
	public final StringExpression Unit;
	public final ShortExpression Hora;
	public final ShortExpression Minuto;
	
	public DataLineCriteria(Criteria criteria) {
		super(criteria);
		ID = new IntegerExpression("ID", this);
		timeStamp = new DateExpression("timeStamp", this);
		Value = new DoubleExpression("Value", this);
		Unit = new StringExpression("Unit", this);
		Hora = new ShortExpression("Hora", this);
		Minuto = new ShortExpression("Minuto", this);
	}
	
	public DataLineCriteria(PersistentSession session) {
		this(session.createCriteria(DataLine.class));
	}
	
	public DataLineCriteria() throws PersistentException {
		this(smartgrid.SmartgridPersistentManager.instance().getSession());
	}
	
	public TariffCriteria createTariffCriteria() {
		return new TariffCriteria(createCriteria("tariff"));
	}
	
	public ContractCriteria createContractCriteria() {
		return new ContractCriteria(createCriteria("contract"));
	}
	
	public DataLine uniqueDataLine() {
		return (DataLine) super.uniqueResult();
	}
	
	public DataLine[] listDataLine() {
		java.util.List list = super.list();
		return (DataLine[]) list.toArray(new DataLine[list.size()]);
	}
}

